package com.med.controller;

import com.med.service.IAppointmentService;
import com.med.vo.AppointmentVO;
import com.ruoyi.common.core.web.controller.BaseController;
import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.common.core.web.page.TableDataInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Project:internet-based-healthcare
 * Package:com.med.controller
 *
 * @Description:
 * @Author:其一
 * @CreateTime: 2025-08-19-15-31
 */
@RestController
@RequestMapping("/appointment")
public class AppointmentController extends BaseController {
    @Autowired
    private IAppointmentService appointmentService;

    @RequestMapping("/list")
    public TableDataInfo selectAppointment(AppointmentVO appointmentVO){
        startPage();
        List<AppointmentVO> appointmentVOS = appointmentService.selectAppointment(appointmentVO);
        return getDataTable(appointmentVOS);
    }

    @PostMapping("/delete")
    public AjaxResult deleteAppointmentById(@RequestBody AppointmentVO appointmentVO){
        return toAjax(appointmentService.deleteAppointmentById(appointmentVO) ? 1:0);
    }

}
